
<template>
  <main-container :headerText="'{{{tipsText}}} ' + (isEdit ? '编辑' : '添加')">
    <div class="content" :key="showPageKey">{{{templateCode}}}</div>
  </main-container>
</template>


<script>
import jhTools from "@/utils/jhTools"; //工具函数
import API from "@/utils/api_config.js"; //引入api

import main_container from '@/components/main_container';
import top_option from "@/components/subCon/topOption";
import date_edit from "@/components/subEditCon/dateEdit";
import upload_img from "@/components/subEditCon/uploadImgEdit";
import bg_editor from "@/components/bg-editor";

import richTextAssembly from "@/components/richTextAssembly.vue";


export default {
  components: {
    "main-container": main_container,
    "top-option": top_option,
    // "input-edit": () => resolve(["@/components/subEditCon/inputEdit"]),
    // "select-edit": () => resolve(["@/components/subEditCon/selectEdit"]),
    "date-edit": date_edit,
    "upload-img": upload_img,
    "bg-editor": bg_editor,
    "richTextAssembly": richTextAssembly,
  },
  props: {},
  data() {
    return {
        showPageKey: 119, //刷新的key
      {{{dataCode}}}
      
      isEdit: false,
      allMethods: "",
    };
  },
  mounted() {
    this.allMethods = this.getAllMethods();
    
    {{{mountedCode}}}
    const id = this.$route.query.id;
    //有id获取编辑数据
    if (id) {
      this.getEditData(id);
      this.isEdit = true;
    }

    // //测试test
    // this.formData.testImgStr = "https://honcollar.oss-cn-shenzhen.aliyuncs.com/file/a3ae8023-d02a-4f3b-9ce5-f5fcd33f1b96.jpg?Expires=1912753798&OSSAccessKeyId=LTAI4FyZ6LRvk2FLjYuRQU1N&Signature=E2EAngZwKqN7QdBBWmUyD5KwZAM%3D,https://honcollar.oss-cn-shenzhen.aliyuncs.com/file/bad5ad4d-5c21-443e-86b8-a407dec6b99f.jpg?Expires=1912753798&OSSAccessKeyId=LTAI4FyZ6LRvk2FLjYuRQU1N&Signature=zYE6gfTWbYyP2QUse%2BZqceX3iKU%3D,https://honcollar.oss-cn-shenzhen.aliyuncs.com/file/8fdd60e0-77af-4aa1-a82e-3087faf9cbc5.jpg?Expires=1912753798&OSSAccessKeyId=LTAI4FyZ6LRvk2FLjYuRQU1N&Signature=gbXVuVghSP9iEcmMbDV4haKHljU%3D,https://honcollar.oss-cn-shenzhen.aliyuncs.com/file/74d2f8ca-564e-4184-af9d-f66f0df36017.jpg?Expires=1912753799&OSSAccessKeyId=LTAI4FyZ6LRvk2FLjYuRQU1N&Signature=0Oru0%2BjoKUNrMVr%2Bjh8rFd1Kqts%3D,https://honcollar.oss-cn-shenzhen.aliyuncs.com/file/1e0280cd-fcab-4103-bf20-1fa7d91dd1c1.jpg?Expires=1912753799&OSSAccessKeyId=LTAI4FyZ6LRvk2FLjYuRQU1N&Signature=sbcX8v22frNg%2BC4rbhqvk6LRAk8%3D";
  },
  methods: {
    {{{methodsCodeFirst}}}

    //取消返回
    handleCancel () {
      this.$router.go(-1);
    },

    /* 方法抽离集合 */
    getAllMethods() {
      var _this = this;
      return {
        {{{methodsCodeSecond}}}
      };
    },
  },
};
</script>

<style lang="scss" scoped>
// @import '~styles/mixins.scss';
// @import '~styles/variables.scss';

{{{styleCode}}}

/* 操作栏相关*/

.content {
  min-height: 100%;
}

.top-option {
  min-height: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fff;
  border-bottom: 1px solid #efefef;
  margin: 0 30px;
  padding: 10px 0;

  .left-box {
    padding-left: 30px;
    max-width: 900px;

    .sub {
      float: left;
      width: 200px;
      margin-left: 10px;
      margin-top: 10px;
    }
  }

  .right-box {
    padding-right: 30px;
    // min-width: 300px;

    .sub {
      float: right;
      margin-left: 10px;
      margin-top: 10px;
    }
  }
}

/* 操作栏相关*/

/* 输入*/
.edit-wrap {
  padding: 40px;
  border-radius: 10px;
  background-color: #fff;
  font-size: 14px;

  label {
    display: inline-block;
    width: 120px;
    text-align: right;
  }
  .tips {
    color: #f10215;
  }
  // //标题
  // .title {
  //   height: 46px;
  //   font-size: 14px;
  //   padding-left: 20px;
  //   font-weight: bold;
  //   line-height: 46px;
  // }

  .top-input {
    .item {
      margin-top: 20px;

      &.img-item {
        display: flex;
        flex-direction: row;
        // margin-bottom: -36px;

        .inline-block {
          max-height: 180px;
          overflow-y: auto;
          padding-right: 10px;
        }
        
        //隐藏滚动条
        .inline-block::-webkit-scrollbar {
          width: 0 !important;
        }
      }

         &.rich-text-item {
        display: flex;
        flex-direction: row;
        // margin-bottom: -36px;

        .inline-block {
          max-height: 160px;
        }
      }

    }
  }

  //标题描述类
  .title-text {
    font-size: 15px;
    line-height: 22px;
    padding-left: 30px;
  }
}


.submit-option {
  width: 300px;
  padding-top: 80px;
  padding-bottom: 60px;
  padding-left: 100px;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

//调整element 样式
.inline-block {
  display: inline-block;
  margin-left: 22px;
  &.id {
    padding-left: 20px;
  }
  el-input {
    width: 20px !important;
  }

  //单项选择
   .radio-box {
      // width: 70px;
      display: inline-block;
      text-align: left;
    }
    .radio-box:nth-child(1) {
      // margin-left: -40px;
    }
}

/* 上传按钮样式*/
.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border: 1px solid #ddd;
}
.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}
.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 107px;
  height: 107px;
  line-height: 107px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 6px;
}
.avatar {
  width: 107px;
  height: 107px;
  display: block;
}
</style>